package logic

import (
	"context"
	"video-management-system/model"

	"video-management-system/userrpc/internal/svc"
	"video-management-system/userrpc/userrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type VideoTopicShowLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewVideoTopicShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VideoTopicShowLogic {
	return &VideoTopicShowLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 视频话题关联详情
func (l *VideoTopicShowLogic) VideoTopicShow(in *userrpc.VideoTopicShowRequest) (*userrpc.VideoTopicShowResponse, error) {
	// todo: add your logic here and delete this line
	var video model.TopicInfo
	var show1 []*userrpc.VideoTopicList
	show := video.VideoTopicShow(model.DB, in.Tid)
	show1 = model.VideoTopicList(model.DB, in.Tid)
	return &userrpc.VideoTopicShowResponse{
		TopicName: show.TopicName,
		List:      show1,
	}, nil
}
